{extend name="layout/base" /}
<!-- 标题 -->
{block name="title"}{$site['site_name']} - 栏目排序{/block}
<!-- CSS -->
{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/lib/nestable/jquery.nestable.css" rel="stylesheet">
{/block}
<!-- 具体内容 -->
{block name="content"}
<h2 class="header-dividing">{$site['site_name']} <small>栏目排序</small></h2>
<div class="navbar navbar-default navbar-content">
    <div class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
            <li><a href="{:url('/site')}"> <i class="icon icon-th-large"></i> 站点管理</a></li>
            <li><a href="{:url('/site/column','siteid='.$site['site_id'])}"> <i class="icon icon-th-list"></i> 栏目管理</a></li>
        </ul>
        <!-- 导航中的表单 -->
        <form class="navbar-form navbar-left" role="search" method="get" action="{:url('/site')}">
            <input type="text" class="form-control" placeholder="搜索站点" name="keywords">
            <button type="submit" class="btn btn-default">搜索</button>
        </form>
    </div>
</div>
<div class="panel">
    <div class="panel-body p10">
        <div class="col-md-6">
            <div class="dd" id="nestable">
                <ol class="dd-list">
                    {$html|raw}
                </ol>
            </div>
        </div>
        <div class="col-md-6">
            <form method="post" action="{:url('/site/column_sort_save')}" id="form-page-submit">
                <input type="hidden" name="site_id" value="{$site['site_id']}">
                <input type="hidden" name="backurl" value="{$backurl}">
                <div class="alert alert-success">
                    <strong>操作方式：</strong> 拖拽要操作的栏目，可以对栏目进行上下移动调整顺序。也可以把一个栏目拖拽到另外一个栏目下面作为子栏目。
                </div>
                <div class="alert alert-danger">
                    <strong>注意：</strong>栏目分类最多只支持三级，超过三级导航位置不显示。
                </div>
                <textarea name="column_json" class="form-control" id="nestable-output" readonly="true"></textarea>
                <div class="col-md-12 text-center p20">
                    <button class="btn btn-nestable" data-action="collapseAll" type="button">全部折叠</button>
                    <button class="btn btn-primary" type="submit">保存排序</button>
                    <a href="{:url('/site/column','siteid='.$site['site_id'])}" class="btn"><i class="icon icon-reply"></i> 返回列表</a>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}


<!-- JS -->
{block name="js"}
    {load href="/static/lib/nestable/jquery.nestable.js"}
    {load href="/static/lib/jquery/jquery.form.js"}
    {load href="/static/lib/jquery/jquery.autofill.min.js"}
    {load href="/static/lib/validator/validator.min.js"}
{/block}
{block name="jscode"}

{/block}